home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / hello1.asm < prev    next >
Assembly Source File  |  1985-06-03  |  3KB  |  66 lines

  1.  
  2.          name      hello
  3.          page      55,132
  4.          title     'HELLO --- print Hello on terminal'
  5. ;
  6. ; HELLO utility to demonstrate various parts
  7. ; of a functional assembly language program,
  8. ; use of segments, and a PC-DOS function call.
  9. ;
  10. ; Ray Duncan, September 1983
  11. ; Converted to .COM file by Jerry D. Stuckle, April, 1984
  12. ;
  13.                              ;show use of some EQUATES:
  14. cr       equ       0dh       ;ASCII carriage return
  15. lf       equ       0ah       ;ASCII line feed
  16.                              ;
  17. ;
  18.                              ;begin the "Code" segment
  19.                              ;containing executable
  20.                              ;machine code
  21. cseg     segment   para public 'CODE'
  22. ;
  23. ; First we need to tell the assembler where the segment registers point.
  24.          assume    cs:cseg,ds:cseg,ss:cseg
  25. ;
  26.          org       100h      ;set the start at 0100h (to make room for the PSP)
  27. ;
  28. print    proc      far       ;actual program code
  29.                              ;is completely contained
  30.                              ;in the "procedure" named
  31.                              ;"PRINT".
  32.                              ;
  33.                              ;now put the offset of the
  34.                              ;message text into DX,
  35.          mov       dx,offset message
  36.                              ;now DS:DX specifies the
  37.                              ;full address of the message.
  38.          mov       ah,9      ;use the PC-DOS function 9
  39.          int       21h       ;to print the string.
  40.                              ;
  41.          xor       ah,ah     ;set DOS function 0 (terminate)
  42.          int       21h       ;and call DOS to end the program
  43.                              ;
  44. print    endp                ;end of the "procedure"
  45.                              ;named "PRINT"
  46.                              ;
  47. message  db        cr,lf,'Hello!',cr,lf,'$'
  48.                              ;
  49. cseg     ends                ;end of the code segment
  50.                              ;containing executable
  51.                              ;program.
  52. ;
  53.                              ;the final "End" statement
  54.                              ;signals the end of this
  55.                              ;program source file, and gives
  56.                              ;the starting address of
  57.                              ;the executable program
  58.          end       print
  59.  
  60.  
  61. Press ENTER to continue: rting address of
  62.                              ;the executable program
  63.          end       print
  64.  
  65.  
  66. Press ENTER to continue: